﻿using Rubberduck.Parsing.Symbols;

namespace Rubberduck.Refactorings.EncapsulateField
{
    /// <summary>
    /// <c>FieldEncapsulationModel</c> consolidates attributes necessary for the <c>EncapsulateFieldUseBackingFieldRefactoringAction</c>
    /// and the <c>EncapsulateFieldUseBackingUDTMemberRefactoringAction</c>.
    /// </summary>
    /// <remarks>
    /// There is no identifier validation or conflict checking performed.
    /// If the target is a UserDefinedType Field and the UserDefinedType is Private,
    /// then the <c>propertyIdentifier</c> parameter is ignored and PropertyIdentifiers for each UserDefinedTypeMember
    /// are generated by the refactoring action.
    /// </remarks>
    public class FieldEncapsulationModel
    {
        public FieldEncapsulationModel(VariableDeclaration target, bool isReadOnly = false, string propertyIdentifier = null)
        {
            Declaration = target;
            IsReadOnly = isReadOnly;
            PropertyIdentifier = propertyIdentifier;
        }

        public VariableDeclaration Declaration { get; }
        public string PropertyIdentifier { set; get; }
        public bool IsReadOnly { set; get; }
    }
}
